<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head>
    <div th:replace="m/head :: head"></div>

    <title>我的发票</title>
</head>

<body class="body-gray">

<!--公用头部-->
<div th:replace="m/head :: body('banner.hidden', 'head-to-personal', '我的发票')"></div>

<!--主体内容-->
<div class="myOrder-content">

    <div th:if="${page.total eq 0}" style="text-align: center; padding: 20px;">
        暂时没有完成的订单!
    </div>

    <div class="myOrder-con">

        <div class="myOrder-box" th:each="item:${page.list}">
            <div class="top clearfix">
                <div class="left">
                    <p>订单编号：[[${item.no}]]</p>
                </div>
                <div class="right">
                    <p th:text="${#dates.format(item.orderTime, 'yyyy-MM-dd HH:mm:ss')}"></p>
                </div>
            </div>

            <!-- 同款 -->
            <div class="middle clearfix" th:if="${item.type eq 1}">
                <div class="middle-con clearfix">
                    <div class="left">
                        <img th:src="${#request.getAttribute('uploadServer') + item.orderDetail.sameStyle.spriteUrl}"/>
                    </div>
                    <div class="right">
                        <h4>作品：[[${item.orderDetail.sameStyle.name}]]</h4>
                        <p>简介：[[${item.orderDetail.sameStyle.description}]]</p>
                    </div>
                </div>
                <div class="down clearfix">
                    <p cus:dict="order-status,${item.status}"></p>
                    <p>合计：<span th:text="${'￥' + #numbers.formatDecimal(item.totalPrice,1,2)}"></span>元</p>
                </div>
            </div>

            <!-- 私人定制 -->
            <div class="middle clearfix" th:if="${item.type eq 2}">
                <div class="middle-con clearfix">
                    <div class="left">
                        <img th:if="${item.orderDetail.photoGrapherUser.portrait ne null}"
                             th:src="${#request.getAttribute('uploadServer') + item.orderDetail.photoGrapherUser.portrait}">
                        <img th:if="${item.orderDetail.photoGrapherUser.portrait eq null and item.orderDetail.photoGrapherUser.gender eq 0}"
                             th:src="${#request.getAttribute('ctx') + '/static/front/img/gender/portrait-female.jpg'}"/>
                        <img th:if="${item.orderDetail.photoGrapherUser.portrait eq null and item.orderDetail.photoGrapherUser.gender eq 1}"
                             th:src="${#request.getAttribute('ctx') + '/static/front/img/gender/portrait-male.jpg'}"/>
                    </div>
                    <div class="right">
                        <h4>导演：[[${item.orderDetail.photoGrapherUser.name ne null ?
                            item.orderDetail.photoGrapherUser.name :
                            item.orderDetail.photoGrapherUser.nickname}]]</h4>
                        <p>简介：[[${item.orderDetail.photoGrapherUser.description}]]</p>
                    </div>
                </div>
                <div class="middle-con clearfix">
                    <div class="left">
                        <img th:if="${item.orderDetail.scriptWriterUser.portrait ne null}"
                             th:src="${#request.getAttribute('uploadServer') + item.orderDetail.scriptWriterUser.portrait}">
                        <img th:if="${item.orderDetail.scriptWriterUser.portrait eq null and item.orderDetail.scriptWriterUser.gender eq 0}"
                             th:src="${#request.getAttribute('ctx') + '/static/front/img/gender/portrait-female.jpg'}"/>
                        <img th:if="${item.orderDetail.scriptWriterUser.portrait eq null and item.orderDetail.scriptWriterUser.gender eq 1}"
                             th:src="${#request.getAttribute('ctx') + '/static/front/img/gender/portrait-male.jpg'}"/>
                    </div>
                    <div class="right">
                        <h4>编剧：[[${item.orderDetail.scriptWriterUser.name ne null ?
                            item.orderDetail.scriptWriterUser.name :
                            item.orderDetail.scriptWriterUser.nickname}]]</h4>
                        <p>简介：[[${item.orderDetail.scriptWriterUser.description}]]</p>
                    </div>
                </div>
                <div class="down clearfix">
                    <p cus:dict="order-status,${item.status}"></p>
                    <p>合计：<span th:text="${'￥' + #numbers.formatDecimal(item.totalPrice,1,2)}"></span>元</p>
                </div>
            </div>

            <div class="bottom">
                <div class="bottom">
                    <!--<a href="javascript:void(0)">删除</a>-->
                    <a th:href="${'/personal/receipt/ready/' + ${item.id}}" class="on">申请发票</a>
                </div>
            </div>
        </div>
    </div>

</div>

<div th:replace="m/foot :: foot"></div>

</body>

<div th:replace="m/foot :: footer('')"></div>

<script>
    $(function () {
        $('.myOrder-con').eq(0).show();


    })
</script>

</html>